<?php
/**
 * Created by PhpStorm.
 * User: Lenovo
 * Date: 2018/7/23
 * Time: 10:30
 */

namespace App\Exports;

use App\Models\BondReturnLogs;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;    //设置标题

class BondReturnExport implements FromCollection,WithHeadings
{
    /*
     * Excel类的构造函数
     * 参数mid ：要导出的参会报名者的所属会议活动的id
     */
    public function __construct($params)
    {
        $this->params = $params;
    }

    //导出数据逻辑
    public function collection()
    {
        return BondReturnLogs::exports($this->params);
    }

    //首行标题
    public function headings(): array
    {
        return [
            '编号',
            '申请人姓名',
            '保证金金额',
            '退还理由',
            '联系人',
            '联系电话',
            '管理员',
            '退还时间',
            '退还状态',
            '申请时间',
        ];
    }
}